<!DOCTYPE html>
<html>

<head>
<title>Random</title>
<script
	src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
</head>
<script>
	$(document).ready(function() {
		//callback handler for form submit
		$("button").click(function(e) {
			console.log("Krishna PRanith" + $("#user").val());

			$.ajax({
				type: "POST",
				contentType : 'application/json',
				url: "http://localhost:8080/RoosterWeb/Auth/login",
				data: JSON.stringify({ "username":$("#user").val(), "password":$("#password").val() }),
				dataType: "json",
			    success: function(data){alert(JSON.stringify(data))
			    
			    },
			    failure: function(errMsg) {
			        alert( " Failed " + errMsg);
			    }
				});
		})
		
		function run(data){
			alert("print it mine");
		}
	});
</script>
<body>

	<div class="body" align="center"></div>
	<div class="grad"></div>
	<div class="header" align="center">
		<div>
			Random</span>
		</div>
	</div>
	<br>
	<div class="login" align="center">
		User Name :: <input type="text" placeholder="username" id="user" ><br>
		<br> password :: <input type="password" placeholder="password"
			id="password"><br>
		<br> <button value="login"> login </button>
		<br> 
	</div>

</body>

</html>